// api.js

export default {
	install(Vue) {
		const http = uni.$u.http

		Vue.prototype.host = http.config.baseURL;
		Vue.prototype.api = {
			login: (params, config = {}) => http.post('user/login', params, config), // 首页
			logout: (params, config = {}) => http.post('user/logout', params, config), // 首页
			register: (params, config = {}) => http.post('user/register', params, config), // 首页
			//今日精选
			get_article_list: (params) => http.post('article/list', params), // 首页
			
			//历史会话
			get_history_list:(params)=>http.post("history/list",params),
			
			get_history_detail:(params)=>http.post("history/detail",params),

			generate:(params,config={})=>http.post("chat/generate",params,config), //生成新回话
			chat:(params,config={})=>http.post("chat/chatmessage",params,config) //创建聊天
		}
	}
}